package com.changgou.listener;

import com.changgou.config.RabbitMQConfig;
import com.changgou.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsDelListener {
	@Autowired
	private ESManagerService esManagerService;
	@RabbitListener(queues = RabbitMQConfig.SEARCH_DEL_QUEUE)
	public void receiveMessage(String spuId){
		System.out.println("删除索引库监听类,监听接收到的消息"+spuId);
		//查询skuList 并导入到es
		esManagerService.delDataBySpuId(spuId);
	}
}
